package com.wkf.truck.controller;


import com.wkf.truck.common.R;
import com.wkf.truck.model.Activity;
import com.wkf.truck.service.ActivityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author lxb
 * @since 2021-02-14
 */
@RestController
@RequestMapping("/activity")
public class ActivityController {

    @Autowired
    private ActivityService activityService;

    /**
     * 获取活动
     *
     * @return
     */
    @GetMapping("/getActivity")
    public R getActivity() {
        List<Activity> list = activityService.list();
        return R.ok().put("data", list);
    }
}
